package com.hq.fxh.No1_Infromation.Infor.Adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.hq.fxh.Utils.LogUtils;
import com.stx.xhb.xbanner.XBanner;

import java.util.ArrayList;

/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/8/8
 * @Email xlwenhao1858@sina.com
 */


public class Help_Infor_Banner {
    Adapter_recycle_infor.TopBannerViewHolder mholder;
    Context mcontext;
    ArrayList<String> data;
    public Help_Infor_Banner(Context context, Adapter_recycle_infor.TopBannerViewHolder holder, ArrayList<String> datas){
        mcontext=context;
        this.mholder=holder;
        data=datas;
    }
    public void doForBanner(){
        mholder.xBanner.setData(data);
        mholder.xBanner.setmAdapter(new XBanner.XBannerAdapter() {
            @Override
            public void loadBanner(XBanner banner, View view, int position2) {
                Glide.with(mcontext).load(data.get(position2)).into((ImageView) view);
            }
        });
        mholder.xBanner.setOnItemClickListener(new XBanner.OnItemClickListener() {
            @Override
            public void onItemClick(XBanner banner, int position) {
                LogUtils.e("xbanner:" + position);
            }
        });
    }
}
